const fs = require("fs")
const path = require("path")
const { json } = require("stream/consumers")
//拼接
const fullPath = path.join(__dirname, "./info.json")
//读取
const res = fs.readFileSync(fullPath, "utf-8")
//转为数组
const arr = JSON.parse(res)
console.log(arr)
//随机获取一位
const num = parseInt(Math.random() * 103)
// console.log(num)
// for (let i = 0; i < arr.length; i++) {
//   if (i == num) {
arr[num].count += 1
//   }
// }
fs.writeFileSync("./info.json", JSON.stringify(arr))
console.log(arr)
